<template>
  <div class="rightbox" v-cloak>
    <h1>公众号信息列表</h1>
    <el-table
    :data="dataList"
    border
    style="width: 96%;margin:2%">
      <el-table-column
        prop="appid"
        label="appid"
      >
      </el-table-column>
      <el-table-column
        prop="secret"
        label="secret"
      >
      </el-table-column>
      <el-table-column
        prop="mchId"
        label="mchId"
      >
      </el-table-column>
      <el-table-column
        prop="signkey"
        label="signkey"
      >
      </el-table-column>
      <el-table-column
        prop=""
        width="100"
        label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="Modify(scope)">修改</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data () {
    return {
      dataList: []
    }
  },
  methods: {
    Search: function () {
      var that = this
      that.getList()
    },
    getList: function () {
      var that = this
      that.$pub.open()
      axios.post('/gp/app/index')
        .then((res) => {
          that.$pub.close()
          if (res.data.code === 0) {
            that.dataList.push(res.data.data)
          } else {
            that.$pub.failcode(that, res.data.code, res.data.data)
          }
        })
        .catch(function () {
          that.$pub.catchbox(that)
        })
    },
    Modify: function (scope) {
      var that = this
      that.$router.push({
        name: 'appModify',
        params: {
          contentindex: 1
        }
      })
    }
  },
  mounted () {
    this.getList()
  }
}
</script>
